﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    


<head>
	<script type="text/javascript">
		$(function(){
				init();
			
		});
		
			function init(){
				$('#t-dg').datagrid({
				loadMsg:''
				
			});
				
			}

		
		
			function deleteAllItem(){
				
					
				$.messager.confirm('清空确认', '是否确定要清空本单位的所有校对信息?', function(r){
					if (r){
			$.ajax({
				url:'<c:url value="/myinfo/Proofrinfo/destroyAllProofrinfo"/>' ,
				type:'post',
				success:function(){
					$('#t-dg').datagrid('reload');
				}
			});
				
          }});
				
			}
		
		function deleteItem(){
			var t = $('#t-dg');
			var row = t.datagrid('getSelected');
			if (row){
				
				$.messager.confirm('删除确认', '是否确定要删除选择的校对信息?', function(r){
						if (r){
				$.ajax({
					url:'<c:url value="/myinfo/Proofrinfo/destroyProofrinfo"/>?id=' + row.id,
					type:'post',
					success:function(){
						$('#t-dg').datagrid('reload');
					}
				});
			}});
				
			}
		}
		
		
		function doQuery(value){
			$('#t-dg').datagrid('load', {
				q: value
			});
		}
	</script>
</head>
<body>
	<div class="easyui-layout" fit="true">
		<div region="north" border="false" style="height:40px;padding:5px;overflow:hidden;">
					<div style="padding-top:3px;float:left">
			<input class="easyui-searchbox" prompt="按关键字进行查询" searcher="doQuery" style="width:300px"></input>
			</div>
					<div style="float:left">
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteItem()">删除校对信息</a>
			<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" onclick="deleteAllItem()">清空本单位校对信息</a>
						</div>
		</div>
		
		
		<div region="center" border="true">
			<table id="t-dg" style="display:none;"
					url="<c:url value='/myinfo/Proofrinfo/getProofrinfoItems'/>"
					singleSelect="true" rownumbers="true" pagination="true"
					border="false" fit="true" fitColumns="true">
				<thead>
					<tr>
						<th field="unitname" width="80" sortable="true">单位名称</th>
<th field="editdate" width="100" sortable="true">录入时间</th>
<th field="pf_unitname" width="80" sortable="true">校对单位名称</th>
<th field="pf_local_id" width="100" sortable="true">校对房源编号</th>
<th field="context" width="150" sortable="false">校对信息</th>
<th field="oper" width="80" sortable="true">操作帐号</th>

					</tr>
				</thead>
			</table>
		</div>
	</div>
	


	

</body>
